package tw.com.hitevision.whiteboard.android.retrofit.response.youtube;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class Video implements Parcelable {
    @SerializedName(value = "kind")
    public String kind;
    @SerializedName(value = "etag")
    public String etag;
    @SerializedName(value = "id")
    public String id;
    @SerializedName(value = "snippet")
    public VideoSnippet videoSnippet;
    @SerializedName(value = "statistics")
    public VideoStatistics videoStatistics;

    protected Video(Parcel in) {
        kind = in.readString();
        etag = in.readString();
        id = in.readString();
        videoSnippet = in.readParcelable(VideoSnippet.class.getClassLoader());
        videoStatistics = in.readParcelable(VideoStatistics.class.getClassLoader());
    }

    public static final Creator<Video> CREATOR = new Creator<Video>() {
        @Override
        public Video createFromParcel(Parcel in) {
            return new Video(in);
        }

        @Override
        public Video[] newArray(int size) {
            return new Video[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(kind);
        dest.writeString(etag);
        dest.writeString(id);
        dest.writeParcelable(videoSnippet, flags);
        dest.writeParcelable(videoStatistics, flags);
    }
}
